# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=py3-magic
_pkgname=python-magic
pkgver=0.4.18
pkgrel=1
pkgdesc="Python3 wrapper for libmagic"
url="https://pypi.python.org/pypi/python-magic/"
arch="noarch"
license="MIT"
depends="python3 libmagic"
makedepends="py3-setuptools"
source="$pkgname-$pkgver.tar.gz::https://github.com/ahupp/$_pkgname/archive/$pkgver.tar.gz
	0001-Fix-tests-with-file-5.39.patch"
builddir="$srcdir/$_pkgname-$pkgver"

replaces="py-magic" # Backwards compatibility
provides="py-magic=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	python3 setup.py build
}

check() {
	LC_ALL=en_US.UTF-8 PYTHONPATH="$PWD/build/lib" python3 test/test.py
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="d5f0047c7537ce0598537629c60aa708623480792d489fa003328b5c6c5b0d42748b6e996f27dc2c164c598813fcf19393567e7ea266a9f0718cf2ddafbd33ac  py3-magic-0.4.18.tar.gz
05365dafab2c762511229d95f3a955bf5ae5de24269070ad78d0439e2c1b0ae4032e6729432eaa6032d295451235cd8a799a1410a5df03f329772247209c387e  0001-Fix-tests-with-file-5.39.patch"
